package com.tarena.servlet;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class UploadFormServlet extends HttpServlet {
	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		response.setContentType("text/html;charset=utf-8");
		request.setCharacterEncoding("utf-8");
		PrintWriter out =  response.getWriter();
		out.println("<html>");
		out.println("<head>" +
								"<title>UploadFormServlet</title>" +
						"</head>");
		out.println("<body>");
		out.println("<h1>UploadFormServlet</h1>");
		out.println("<form action='UploadActionServlet' method='POST' enctype='multipart/form-data'>");                        
		out.println("<table border='1' width='80%'>");
		out.println("<tr>");
		out.println("<td>文件地址:</td>");
		out.println("<td><input type='file' name='file'/></td>");
		out.println("</tr>");
		out.println("</table>");
		out.println("<input type='submit' value='确认提交'>");
		out.println("<input type='reset' 	value='清空'>");
		out.println("</form>");
		out.println("</body>");
		out.println("</html>");	
	}
}
